﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 软构大作业
{
    public partial class Form8 : Form
    {
        private new AutoAdaptWindowsSize AutoSize;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x02000000;
                return cp;
            }
        }
        public Form8()
        {
            InitializeComponent();
        }

        private void toolTip1_Popup(object sender, PopupEventArgs e)
        {

        }

        private void Form8_FormClosed(object sender, FormClosedEventArgs e)
        {
            Global.Instance.form8login = null;
            Global.Instance.form5login.Show();
        }

        private void 我的借阅ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if(Global.Instance.form14login==null)
            {
                Form14 form14 = new Form14();
                Global.Instance.form14login = form14;
            }
            Global.Instance.form14login.Show();
            Global.Instance.form8login.Hide();
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Global.Instance.form8login.Hide();
            Global.Instance.form5login.Show();
        }

        private void 个人信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 查询图书ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Global.Instance.form15login == null)
            {
                Form15 form15 = new Form15();
                Global.Instance.form15login = form15;
            }
            Global.Instance.form15login.Show();
            Global.Instance.form8login.Hide();
        }

        private void Form8_Load(object sender, EventArgs e)
        {
            AutoSize = new AutoAdaptWindowsSize(this);
            this.SizeChanged += new EventHandler(Form_SizeChanged);
        }
        private void Form_SizeChanged(object sender, EventArgs e)
        {//窗体大小改变事件
            if (AutoSize != null) // 一定加这个判断，电脑缩放布局不是100%的时候，会报错
            {
                AutoSize.FormSizeChanged();
            }
        }
    }
}
